<!DOCTYPE html>
<html lang="cn">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta charset="utf-8" />
    <title>{:config('cnpscy.site_web_title') } - {:cnpscy_config('web_admin_title')}</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <link rel="Bookmark" href="/favicon.ico">
    <link rel="Shortcut Icon" href="/favicon.ico">

    <link rel="stylesheet" href="__ADMIN__/css/common.css?v={:config('cnpscy.resource_version_number')}">
    <link rel="stylesheet" href="__ADMIN__/css/other.css?v={:config('cnpscy.resource_version_number')}">
    <link rel="stylesheet" href="__LAYER__/layer.css?v={:config('cnpscy.resource_version_number')}">

    <!-- basic styles -->
    <link href="__ACE__/css/bootstrap.min.css?v={:config('cnpscy.resource_version_number')}" rel="stylesheet"/>
    <link rel="stylesheet" href="__ACE__/css/font-awesome.min.css?v={:config('cnpscy.resource_version_number')}"/>

    <!--[if IE 7]>
    <link rel="stylesheet" href="__ACE__/css/font-awesome-ie7.min.css?v={:config('cnpscy.resource_version_number')}"/>
    <![endif]-->

    <!-- page specific plugin styles -->

    <link rel="stylesheet" href="__ACE__/css/ace.min.css?v={:config('cnpscy.resource_version_number')}"/>
    <link rel="stylesheet" href="__ACE__/css/ace-rtl.min.css?v={:config('cnpscy.resource_version_number')}"/>
    <link rel="stylesheet" href="__ACE__/css/ace-skins.min.css?v={:config('cnpscy.resource_version_number')}"/>

    <!--[if lte IE 8]>
    <link rel="stylesheet" href="__ACE__/css/ace-ie.min.css?v={:config('cnpscy.resource_version_number')}"/>
    <![endif]-->
</head>
<body class="login-layout" style="height: 100%;width: 100%;position: absolute;overflow-x: hidden">
<div class="main-container" style="height: 100%;width: 100%;position: absolute;">
    <div class="main-content">
        <div class="row" style="height: 100%;width: 100%;position: absolute;">
            <div class="" style="height: 100%;width: 100%;position: absolute; text-align: center;">
                <div class="login-container" style="top:25%;position: relative;">
                    <div class="center">
                        <h1>
                            <i class="icon-leaf green"></i>
                            <span class="red">{:config('cnpscy.site_web_title')}</span>
                            <span class="white">管理平台</span>
                        </h1>
                        <!-- <h4 class="blue">&copy; Company Name</h4> -->
                    </div>

                    <div class="space-6"></div>

                    <div class="position-relative">
                        <div id="login-box" class="login-box visible widget-box no-border" style="margin-top:40px">
                            <div class="widget-body">
                                <div class="widget-main">
                                    <h4 class="header blue lighter bigger">
                                        <i class="icon-coffee green"></i>
                                        请输入账户信息
                                    </h4>

                                    <div class="space-6"></div>
                                    <form action="{:url()}" method="post" class="first_form"
                                          onsubmit="login( this );return false;" return-url="{:url('indexs/index')}">
                                        <fieldset>
                                            <label class="block clearfix">
                                                <span class="block input-icon input-icon-right">
                                                    <input type="text" class="form-control"
                                                           placeholder="用户名" name="login_name"/>
                                                    <i class="icon-user"></i>
                                                </span>
                                            </label>

                                            <label class="block clearfix">
                                                <span class="block input-icon input-icon-right">
                                                    <input type="password" class="form-control"
                                                           placeholder="密码" name="password" autocomplete="off"/>
                                                    <i class="icon-lock"></i>
                                                </span>
                                            </label>

                                            <div class="space"></div>

                                            <div class="clearfix">
                                                <button type="submit"
                                                        class="width-100 pull-right btn btn-sm btn-primary">
                                                    <i class="icon-key"></i>
                                                    登录
                                                </button>
                                            </div>

                                            <div class="space-4"></div>
                                        </fieldset>
                                    </form>
                                </div><!-- /widget-main -->
                            </div><!-- /widget-body -->
                        </div><!-- /login-box -->
                    </div><!-- /position-relative -->
                </div>
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div>
</div><!-- /.main-container -->

<!-- basic scripts -->

<script src="__STATIC__/jquery-2.1.1.min.js?v={:config('cnpscy.resource_version_number')}"></script>

<script type="text/javascript">
    if ("ontouchend" in document) document.write("<script src='{ asset('__ACE__/js/jquery.mobile.custom.min.js?v={:config('cnpscy.resource_version_number')}'>" + "<" + "/script>");
</script>

<script src="__LAYER__/layer.js?v={:config('cnpscy.resource_version_number')}"></script>
<script src="__STATIC__/function.js?v={:config('cnpscy.resource_version_number')}"></script>
<script src="__STATIC__/axios/axios.min.js?v={:config('cnpscy.resource_version_number')}"></script>

<script type="text/javascript">
    webAdminTitle = '小丑路人';
    webTitle = [webAdminTitle, 'text-align:center;']

    set_axios(axios);//axios全局设置

    function login(_this) {
        var form = 'first_form',
            form_data = $('.' + form).serialize();
        var user_acc = verifyRemind('管理员账户不可为空！', $('form.' + form + ' input[name=login_name]'), 1);
        if (!user_acc) return false;
        var password = verifyRemind('管理员密码不可为空！', $('form.' + form + ' input[name=password]'), 1);
        if (!password) return false;

        var login_before_url = localStorage.getItem("login_before_url") || $('.' + form).attr('return-url');
        axios.post($('.' + form).attr('action'), form_data).then(function (data) {
            switch (parseInt(data.status)) {
                case 0:
                    layerMsg(data.msg, 5, layerJumpTime);
                    break;
                case 1:

                    layerMsg(data.msg, 1, layerJumpTime, 3, login_before_url);
                    break;
                default:
                    layerMsg(data.msg, 5);
                    break;
            }
        }).catch(function (res) {
        });
    }
</script>
</body>
</html>